package com.ddwl.order.controller;

import com.ddwl.common.annotation.Auth;
import com.ddwl.common.constant.BaseEnum;
import com.ddwl.common.controller.BaseController;
import com.ddwl.order.service.BacklogServer;
import com.ddwl.schema.vo.base.RestVo;
import com.ddwl.schema.vo.order.BackLogVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 类待办事项
 * @author wenbin
 */
@Api(tags = "待办事项")
@RestController
public class BacklogController extends BaseController {
    

    @Resource
    private BacklogServer backlogServer;

    @GetMapping("/getBacklog")
    @Auth(product = {BaseEnum.ProductEnum.CONSOLE})
    @ApiOperation("获取待办事项接口")
    public RestVo<BackLogVo> getStatistics(){
        BackLogVo backlog = backlogServer.getBacklog();
        return RestVo.ok(backlog);
    }

    @GetMapping("/sendBackLogMsg")
    //@Auth(product = {BaseEnum.ProductEnum.API})
    @ApiOperation("发送待办事项信息")
    public RestVo sendStatisticsMsg() throws Exception {
        backlogServer.sendBackLogMsg();
        return RestVo.ok();
    }



}
